package com.matt.components.utilbeans;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

@Slf4j
@Component
public class TerminateBean {

    @PreDestroy
    public void onDestroy()  {
        try{
            throw new Exception("Spring Container is destroing!");
        } catch (Exception e) {
            e.printStackTrace();
        }
        log.info(Thread.currentThread().toString());
    }
}